<?php
namespace app\admin\controller;

use app\BaseController;
use think\App;
use think\facade\Config;
use think\facade\Session;
use think\facade\View;


class Index extends BaseController
{
    public function __construct()
    {
        //dump(Session::get('userId'));
        //exit;
        if(Session::has('userInfo')){
			$userInfo = unserialize(Session::get('userInfo'));
            View::assign('userInfo',$userInfo);
			
        }else{
            header('Location:'.Config::get('webconf.web_hot').'/admin/Login/index');
        }

    }
	//首页 ifream框架的方法
    public function index()
    {
        return View::fetch();
    }
	//首页主要页面的方法
    public  function main()
    {
        return View::fetch();
    }
    public function hello($name = 'ThinkPHP6Admin')
    {
        return 'hello,' . $name;
    }
	public function useGit()
	{
		return 'This is Git';
	}
}
